#ifndef __BSP_PID__
#define __BSP_PID__

//#define INC_EAZY          //简单增量式


typedef struct
{
    float Kp, Ki, Kd;       //三种系数
    float cur_err, pre_err; //当前错误和前一个错误

    float pre2_err;     //前两个错误

    float locSum;       //累计积分值
}pid_t;

int pid_init (pid_t *pid, float kp, float ki, float kd);
float pid_calculatePos (pid_t *pid, float SetValue, float ActualValue);
float pid_calculateInc (pid_t *pid, float SetValue, float ActualValue);
#endif
